<template>
  <div>
    <p>child</p>
    <!-- <p>{{ modelValue }}</p> -->
    <p>{{ num }}</p>
    <button @click="handleClick">修改</button>
  </div>
</template>

<script lang="ts">
export default {
  name: "Child",
  props: {
    // modelValue: {
    //   type: Number,
    //   required: true,
    // },
    num: {
      type: Number,
      required: true,
    },
    count: {
      type: Number,
      required: true,
    },
  },
  // 声明接受自定义事件
  emits: [
    // "update:modelValue",
    "update:num",
    "update:count",
  ],
  methods: {
    handleClick() {
      // 触发自定义事件
      // this.$emit("update:modelValue", this.modelValue + 1);
      this.$emit("update:num", this.num + 1);
      // this.$emit("update:count", this.count + 1);
    },
  },
};
</script>

<style scoped></style>
